package com.gxa.controller;

import com.gxa.common.R;
import com.gxa.pojo.Sys_Role;
import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@Api(value = "用户数据test",tags = "用户数据接口API")
@RequestMapping("/Role")
public class RoleController {
    @RequestMapping(value = "/addRole",method = RequestMethod.POST)
    @ApiOperation(value = "添加角色接口",notes = "增加角色",httpMethod = "get", response = String.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R addRole(@RequestBody @ApiParam(name = "sys_role",value = "角色") Sys_Role sys_role){
        R r=new R();
        System.out.println("title:"+sys_role.getTitle());
        System.out.println("name:"+sys_role.getName());
        if (sys_role!=null){
            r.setCode(200);
            r.setMsg("success");
            r.setData(sys_role);
        }
        return r;
    }
    @RequestMapping(value = "/query",method = RequestMethod.GET)
    public R query(){
        return null;
    }
}
